home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: reversing a string
- Date: Wed, 10 Apr 96 11:30:45 GMT
- Organization: none
- Message-ID: <829135845snz@genesis.demon.co.uk>
- References: <4k6cjl$j8f@central.server.swt.edu> <4k6jks$fh9@solutions.solon.com> <DpLtt5.Lqu@iquest.net>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <DpLtt5.Lqu@iquest.net> dlmiller@iquest.net "Doug Miller" writes:
-
- >seebs@solutions.solon.com (Peter Seebach) wrote:
- >>I can't see a way to reverse in place without a temporary of some sort,
- >>or a loop of some sort, or something which is fundementally equivalent
- >>to one of those. There may be one, but I don't know it.
- >>
- >>-s
- >
- >How about this:
- >
- >void swap (char *s) {
- > if (strlen(s) > 1) {
-
- strlen() is fundamentally based on a loop.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-